﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TribesPSO
{
    /// <summary>
    /// A multi threaded search space that uses IndependantGaussianParticles to minimize the solution
    /// </summary>
    public sealed class MultithreadedGaussianSearchSpace : MultithreadedSearchSpace<IndependentGaussianParticle>
    {
        /// <summary>
        /// Creates a new Multi-threaded gaussian search space to solve the specified objective function
        /// </summary>
        /// <param name="objectiveFunction">An IObjectiveFunction to solve</param>
        public MultithreadedGaussianSearchSpace(IObjectiveFunction objectiveFunction)
            : base(objectiveFunction) { }

        /// <summary>
        /// Creates a new IndependentGaussianParticle at the specified location and the SearchSpaces own IObjectiveFunction
        /// </summary>
        /// <param name="position">The initial location of the new particle</param>
        /// <returns>A new IndependentGaussianParticle</returns>
        protected override IndependentGaussianParticle GenerateParticleAtPosition(EuclidianVector position)
        {
            return new IndependentGaussianParticle(this.GoodnessFunction, position);
        }
    }
}
